package com.ddzh.job;

import com.ddzh.service.SetmealService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 定时任务
 */
@Component
@JobHandler(value = "job.clearClass") //定义对具体job的描述
public class ClearOssObject extends IJobHandler {

    @Resource
    private SetmealService setmealService;

    @Override
    public ReturnT<String> execute(String s) throws Exception {
        System.out.println("执行成功。。。。");
        setmealService.clearOssObject();
        return SUCCESS;//默认情况下执行成功
    }

}
